package com.kaili.zuul.mapper;

import com.kaili.common.entity.BaseBtn;
import com.kaili.common.entity.BaseMenu;
import com.kaili.common.entity.BaseUser;
import com.kaili.common.entity.LoginDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;
import java.util.Map;

@Mapper
public interface LoginMapper {
    LoginDetail loadUserByUsername(String username);

    LoginDetail loadEmployeeByUsername(String username);

    @Cacheable(value = "baseMenus", key = "'menu_id'")
    List<BaseMenu> getAllBaseMenu();

    Map getSiteByEmployeeId(Integer employeeId);

    String getCompanyName(Integer companyCode);

    String getParamValue(String paramKey);

    /**
     * 系统登陆成功后,根据当前语言环境,设置数据字典名称
     * @param language
     */
    void updateDict(@Param("language") String language);

    //失败次数为4次账户锁定
    void updateUnlock(String name);

    //查询登陆可以错误几次
    String systemParmeterConfig(String name);

    public List<String> queryBtnsByParentId(int parentId);

    public BaseUser loadUserByUserid(Integer userId);

    //登录成功修改登录次数
    public int updateLoadTimes(Long id);
}
